package com.example.wangfanwangluo.wangfanboss;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;

public class register extends AppCompatActivity {
    private EditText phone;
    private EditText pw;

    private Button code;
    private EditText name;
    private Button registerbtn;
    private Button loginbtn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        ActionBar actionbar = getSupportActionBar();
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (actionbar != null){
            actionbar.hide();
        }
        initViews();
    }
    //初始化ui
    private void initViews(){
        phone = (EditText)findViewById(R.id.phone_register);
        pw = (EditText)findViewById(R.id.pw_register);
        code = (Button)findViewById(R.id.getcode_register);
        registerbtn = (Button)findViewById(R.id.zhuce_register);
        loginbtn = (Button)findViewById(R.id.login_register);
        //给获取验证码添加事件，点击内容发生改版，颜色改变
        code.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //
            }
        });
        //点击注册按钮
        registerbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //网络请求，回到登录页面
               finish();
            }
        });
        //去登录界面
        loginbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //登录界面
                Intent intent = new Intent(register.this,Login.class);
                startActivity(intent);
            }
        });
    }
}
